package com.chaofan.kings_poster;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.io.IOException;
import java.net.InetAddress;

@SpringBootApplication
public class KingsPosterApplication {

	private static final Logger LOGGER = LoggerFactory.getLogger(KingsPosterApplication.class);

	public static void main(String[] args) throws IOException {
		ConfigurableApplicationContext application= SpringApplication.run(KingsPosterApplication.class, args);
		Environment env = application.getEnvironment();
		LOGGER.info("\n[----------------------------------------------------------]\n\t" +
						"启动成功！点击进入:\thttp://{}:{}" +
						"\n[----------------------------------------------------------]",
				InetAddress.getLocalHost().getHostAddress(),
				env.getProperty("server.port"));
//		Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler http://"+InetAddress.getLocalHost().getHostAddress()+":"+env.getProperty("server.port"));
	}
}
